<?php
	include_once('themes/head.php');
	include_once('controller/userController.php');
?>
<div>
<pre>Daftar User</pre>
<table class="table table-bordered">
<?php
if(!isset($_GET['admin']))
{
	echo "<div class=\"alert\">
		<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
		<strong>Peringatan!</strong> Anda Tidak Memiliki Wewenang.
		</div>";
}
else
{
	if(isset($d_users))
	{
		if($d_users!=0)
		{
?>	
			<thead>
			<th>Username</th>
			<th>Nama</th>
			<th>Email</th>
			<th>Level</th>
			<th>Ban User</th>
			</thead>
			<?php
				foreach($d_users as $user2)
				{
					echo "<tr>";
					echo "<td>".$user2['username']."</td>";
					echo "<td>".$user2['nama']."</td>";
					echo "<td>".$user2['email']."</td>";
					echo "<td>".$user2['level']."</td>";
					echo "<td><a href=\"user_admin.php?admin&ban=".$user2['id']."\"><i class=\"icon-lock\"></i></a></td>";
					echo "</tr>";
				}
			?>
<?php			
		}
		else
		{
			echo "<div class=\"alert\">
				<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
				Data Tidak Ada.</div>";
		}
	}
}
?>
</table>
</div>
<?php
	include_once('themes/footer.php');
?>